<script>
	import { getUnitPrice } from './common/js/api/api.js'
	export default {
		onLaunch: function() {
			console.log('App Launch')
			getUnitPrice().then(res => {
				var rate = res.data.usdRate / 31.1035;
				res.data.pallBid = Math.round(res.data.pallBid * rate);
				res.data.rhodBid = Math.round(res.data.rhodBid * rate);
				res.data.platBid = Math.round(res.data.platBid * rate);
				wx.setStorageSync('unitPrice', res.data);
			})
			setInterval(() => {
				getUnitPrice().then(res => {
					var rate = res.data.usdRate / 31.1035;
					res.data.pallBid = Math.round(res.data.pallBid * rate);
					res.data.rhodBid = Math.round(res.data.rhodBid * rate);
					res.data.platBid = Math.round(res.data.platBid * rate);
					wx.setStorageSync('unitPrice', res.data);
				})
			},15000)
      let carType = require('@/common/js/carType.json');
			wx.setStorageSync('carTypeImg', carType.Data);
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "uview-ui/index.scss";
	@import url("./common/css/system.css");
	@import url("./common/css/my.css");
</style>
